package freespiritsocial.io.user.viewmodel

import freespiritsocial.io.user.data.model.bean.PostPojo
import freespiritsocial.io.user.network.apiService
import me.hgj.jetpackmvvm.base.viewmodel.BaseViewModel
import me.hgj.jetpackmvvm.callback.livedata.UnPeekLiveData
import me.hgj.jetpackmvvm.ext.request

class MapViewModel: BaseViewModel() {
    val postItemResult = UnPeekLiveData<PostPojo>()
    fun getAreaPostList0(area: String,action: (List<PostPojo>) -> Unit) {
        request({
            apiService.getAreaPostList(area)
        },{
            action(it)
        })
    }

    fun getPost(id: Long?) {
        request({
            apiService.getInvitationDetail(id)
        },{
            postItemResult.value = it
        },isShowDialog = true)
    }
}
